<template>
  <div>
    <c-table
      border
      :loading="loading"
      :stripe="false"
      :columns="tableColumns"
      :data="govMessageLoanLending"
    ></c-table>
    <div class="query-pagination">
      <div></div>
      <el-pagination
        layout="total, prev, pager, next, jumper"
        :current-page.sync="params.index"
        :page-size="params.size"
        :total="govMessageLoanLendingCount"
        @current-change="getData"
      ></el-pagination>
    </div>
  </div>
</template>
<script>
import { getLoanLending } from '@/gov/store/modules/govMessage'
import { tableColumns } from '@/gov/views/index/PanelMessageLoanLending'

export default {
  components: {},
  props: {},
  data() {
    return {
      params: {
        index: 1,
        size: 20,
        address_code: '',
      },
      tableColumns,
      govMessageLoanLendingCount: 0,
      govMessageLoanLending: [],
    }
  },
  computed: {},
  watch: {},
  created() {
    this.params.address_code = this.$utils.getAddressCode()
    this.getData()
  },
  mounted() {},
  methods: {
    async getData() {
      this.loading = true
      const [res] = await this.$utils.promise(getLoanLending('', 1, this.params))
      const data = (res && res.data) || []
      this.govMessageLoanLendingCount = data.totalCount || 0
      this.govMessageLoanLending = data.data || []
      this.loading = false
    },
  },
}
</script>
<style lang="scss" scoped></style>
